#!/bin/sh

. $LKP_SRC/lib/upload.sh
. $LKP_SRC/lib/debug.sh
. $LKP_SRC/lib/reproduce-log.sh

cd $BENCHMARK_ROOT/leaking-addresses || die "can not enter $BENCHMARK_ROOT/leaking-addresses"

# test is easy to trigger error "timed out parsing",
# adjust the value of TIMEOUT could avoid this issue
# timed out parsing: /sys/kernel/debug/regmap/hdaudioC0D3-hdaudio/range
# timed out parsing: /sys/kernel/debug/regmap/hdaudioC0D0-hdaudio/range
# timed out parsing: /proc/kallsyms
sed -i "s/TIMEOUT = 10/TIMEOUT = 60/g" leaking_addresses.pl

run_test()
{
	mkdir result
	log_cmd ./leaking_addresses.pl --output-raw result/scan.out
	log_cmd ./leaking_addresses.pl --input-raw result/scan.out --squash-by-filename | tee result/scan.result
}

run_test

upload_files -t results result/*
